<template>
    <el-input
            v-model="yuanshen_url"
            :autosize="{ minRows: 2, maxRows: 4 }"
            type="textarea"
            placeholder="请按照教程输入您原神查询祈愿地址"
    />
    <br>
    <br>
    <el-button type="primary" round class="myBtn" @click="mainIndex">提交</el-button>
</template>

<script>
    import {reactive,ref} from 'vue'
    import {useRoute,useRouter} from 'vue-router'
    import { ElMessage } from 'element-plus'
    import getData from "@/api/getData";
    import {useStore} from 'vuex'

    export default {
        name: "Myinput",
        setup(){
            const store = useStore()
            console.log("store==",store)
            // 实例化router对象
            let router = useRouter()
            // 变成一个响应式对象
            let yuanshen_url = ref('')
            function mainIndex() {
                ElMessage({
                    message: '提交成功,即将呈现精彩内容',
                    type: 'success',
                })
                store.commit('SENDURL',yuanshen_url.value)
                // getData.test(yuanshen_url.value)
                router.push({path:'/mainIndex'})
            }
            return {
                yuanshen_url,
                mainIndex
            }

        }
    }
</script>

<style scoped>
    .myBtn{
        margin-left: 236px;
    }
</style>